<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/fullcalendar-3.0.1/lib/jquery.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/resources/script/layer/layer.js"></script>
<title>新用户注册</title>
<script type="text/javascript">
	$(document).ready(function() {
		/* $("#submit").click(function() {
			var p1 = $("#password").val();
			var p2 = $("#rePassword").val();
			if (p1 == p2 && p1 != "") {
				$("form").submit();
			} else {
				var index = layer.alert("两次密码输入不一致", {
					skin : 'layui-layer-molv', //样式类名
					closeBtn : 0
				}, function() {
					$("#password").val("");
					$("#rePassword").val("");
					layer.close(index);
				});
			}
		}) */
		$("form").submit(function(e) {
			var p1 = $("#password").val();
			var p2 = $("#rePassword").val();
			if (p1 == p2 && p1 != "") {
			} else {
				e.preventDefault();
				var index = layer.alert("两次密码输入不一致", {
					skin : 'layui-layer-molv', //样式类名
					closeBtn : 0
				}, function() {
					$("#password").val("");
					$("#rePassword").val("");
					layer.close(index);
				});
			}

		});
	})
</script>
<style type="text/css">
button, input {
	border: 1px solid #999;
	padding: 5px 5px;
	/* margin: 0 10px 10px 0; */
}

tr {
	height: 80px;
}
</style>
</head>
<body>
	<div style="margin: 0 auto; width: 400px;">
		<sf:form action="${pageContext.request.contextPath }/doRegister"
			commandName="dlLoginuser" id="registerForm" method="post">
			<table>
				<tr>
					<td><label>用户名:</label></td>
					<td><sf:input path="name" /></td>
				</tr>
				<tr>
					<td><label>密码:</label></td>
					<td><sf:password id="password" path="password" /></td>
				</tr>
				<tr>
					<td><label>密码:</label></td>
					<td><input id="rePassword" type="password" /></td>
				</tr>
				<tr>
					<td><label>真实姓名:</label></td>
					<td><sf:input path="realName" /></td>
					<td><label class="error"><sf:errors path="realName"></sf:errors>
					</label></td>
				</tr>
				<tr>
					<td><label>手机号码:</label></td>
					<td><sf:input path="phoneNumber" /></td>
					<td><label class="error"><sf:errors path="phoneNumber"></sf:errors>
					</label></td>
				</tr>
				<tr>
					<td colspan="3"><input type="submit" id="submit"
						value="提&nbsp;&nbsp;交"> <input style="float: right;"
						type="button" id="cancel" value="取&nbsp;&nbsp;消"
						onclick="window.location.href='${ pageContext.request.contextPath }'"></td>
				</tr>
			</table>
		</sf:form>
	</div>
</body>
</html>